<!DOCTYPE html>
<html>
<head>
    <title>SSE Example</title>
</head>
<body>
<h1>Server Sent Events</h1>
<script>
    const eventSource = new EventSource('/stream-sse');

    eventSource.onmessage = function (event) {
        console.log(event.data);
        // 处理接收到的数据
    };

    eventSource.onerror = function (event) {
        console.error("EventSource failed.");
    };
</script>
</body>
</html>